package designpatterns.strategy;

interface TaxStrategy {
    float calc();
}

class CNTaxStrategy implements TaxStrategy {
    @Override
    public float calc() {
        // Do some login
        return 0;
    }
}

class USTaxStrategy implements TaxStrategy {
    @Override
    public float calc() {
        // Do some logic
        return 0;
    }
}

class DETaxStrategy implements TaxStrategy {
    @Override
    public float calc() {
        // Do some logic
        return 0;
    }
}

// 扩展一个法国税率策略
class FRTaxStrategy implements TaxStrategy {
    @Override
    public float calc() {
        // Do some logic
        return 0;
    }
}

public class Strategy {
    private TaxStrategy taxStrategy; // 面向策略接口
    public float calc() {
        return taxStrategy.calc(); // 多态
    }
    // getter and setter
}
